﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="OrderReport.aspx.cs" Inherits="Physio_Clinic.WebForm7" %>
<%@ Register assembly="Devart.Data.Linq.Web, Version=3.1.34.0, Culture=neutral, PublicKeyToken=09af7300eec23701" namespace="Devart.Data.Linq.Web" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% if (currentUser != null && currentUser.Username == "admin")
       {   
      %>

    <p>
        วันที่</p>
    <p>
        <asp:Calendar ID="CalendarOrder" runat="server" 
            onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>
    </p>
    <p>
        รายการรับชำระค่ารักษา/จ่ายยา</p>
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="White" 
            BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" 
            DataKeyNames="BookId" DataSourceID="DbLinqDataSource1" GridLines="None" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            RowHeaderColumn="BookId" ShowHeaderWhenEmpty="True" Width="709px" 
            onrowcommand="GridView1_RowCommand" 
        onrowcreated="GridView1_RowCreated">
        <Columns>
            <asp:ButtonField ButtonType="Button" CommandName="ViewOrder" HeaderText="ดู" 
                Text="ดู" />
            <asp:ButtonField ButtonType="Button" CommandName="DeleteOrder" HeaderText="ลบ" 
                Text="ลบ" />
            <asp:BoundField DataField="AppointmentTime" HeaderText="วันที่" 
                SortExpression="AppointmentTime" />
            <asp:BoundField DataField="OrderNumber" HeaderText="เลขที่ใบสั่งซื้อ" 
                ReadOnly="True" SortExpression="OrderNumber" />
            <asp:BoundField DataField="CustomerName" HeaderText="ชื่อลูกค้า" 
                ReadOnly="True" SortExpression="CustomerName" />
            <asp:BoundField DataField="TotalPrice" HeaderText="ราคารวม" 
                SortExpression="TotalPrice" ReadOnly="True" />
        </Columns>
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#594B9C" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#33276A" />
    </asp:GridView>
    <cc1:DbLinqDataSource ID="DbLinqDataSource1" runat="server" 
        ContextTypeName="Physio10Context.Physio10DataContext" EntityTypeName="" 
        TableName="Bookings" Where="AppointmentTime.Value.Date == @AppointmentTime">
        <WhereParameters>
            <asp:ControlParameter ControlID="CalendarOrder" Name="AppointmentTime" 
                PropertyName="SelectedDate" Type="DateTime" />
        </WhereParameters>
    </cc1:DbLinqDataSource>

    <% }
       else
       { %><asp:Label ID="ErrorText" runat="server" 
    Text="สิทธิหน้านี้สำหรับ ผู้ดูเเลระบบเท่านั้น " ForeColor="Red" 
        style="text-align: center"></asp:Label><asp:HyperLink ID="HyperLink1" 
    runat="server" NavigateUrl="http://physio10.com/" > click</asp:HyperLink><% } %>
</asp:Content>
